package com.usian.behavior.controller;

import com.usian.apis.behavior.ApBehaviorEntryControllerApi;
import com.usian.behavior.service.ApBehaviorEntryService;
import com.usian.model.behavior.pojos.ApBehaviorEntry;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/v1/behavior_entry")
public class ApBehaviorEntryController  implements ApBehaviorEntryControllerApi {

    @Autowired
    private ApBehaviorEntryService apBehaviorEntryService;

    @Override
    @GetMapping("/one")    /*根据用户id查询实体*/
    public ApBehaviorEntry findApBehaviorEntry(@RequestParam("userId") Integer userId, @RequestParam(value = "equipmentId",required = false)Integer equipmentId) {
        return apBehaviorEntryService.findByUserIdOrEquipmentId(userId,equipmentId);
    }
}
